package cn.stu.framework.service;

import cn.stu.common.utils.ApiData;
import cn.stu.framework.dto.LoginDto;
import cn.stu.framework.entity.Users;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;

/**
 * 服务类
 *
 * @author ${author}
 * @since 2022-08-04
 */
public interface UsersService extends IService<Users> {

    /**
     * 登录
     *
     * @param users   用户
     * @param request 请求
     * @return {@link ApiData}
     */
    ApiData login(LoginDto users, HttpServletRequest request);

    /**
     * 设置角色
     *
     * @param uid    UID
     * @param roleId 角色ID
     * @return {@link ApiData}
     */
    ApiData setRole(Long uid, Long roleId);

    /**
     * 获取路由
     *
     * @param roleId 角色ID
     * @return {@link ApiData}
     */
    ApiData getRoutes(Long roleId);

    /**
     * 登出
     *
     * @param request 请求
     * @return {@link ApiData}
     */
    ApiData logout(HttpServletRequest request);

    String outImage(String url);
}
